<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>基金分红记录</title>

    <link rel="stylesheet" href="http://cdn.viptool.cn/lib/bootstrap/3.3.5/css/bootstrap.min.css">
    <link href="../../resource/hotui/css/font-awesome.min.css" th:href="@{/resource/hotui/css/font-awesome.min.css}"
          rel="stylesheet">
    <!-- Morris -->
    <link href="http://cdn.viptool.cn/lib/morris.js/0.4.3/morris.css" rel="stylesheet">
    <link href="http://cdn.viptool.cn/lib/animate.css/2.1.1/animate.min.css" rel="stylesheet">
    <link href="../../resource/hotui/css/style.min-1.0.8.css" th:href="@{/resource/hotui/css/style.min-1.0.8.css}"
          rel="stylesheet">
    <link href="../../resource/hotui/css/hotui.style.override.css"
          th:href="@{/resource/hotui/css/hotui.style.override.css}" rel="stylesheet"/>
    <link href="http://cdn.viptool.cn/lib/switchery/0.8.2/switchery.min.css" rel="stylesheet"/>
    <link href="http://cdn.viptool.cn/lib/bootstrap-daterangepicker/2.1.25/daterangepicker.min.css" rel="stylesheet">
    <link href="../../resource/lib/imageview/css/imageviewer.css" rel="stylesheet"/>

    <style type="text/css">
        .hr-line-dashed {
            margin: 10px 0;
            height: 1px;
            border-top: 1px dashed #e7eaec;
            background-color: #fff;
            color: #fff;
        }

        .city-picker-selector select {

        }

        .daterangepicker {
            z-index: 999999999 !important;
        }
    </style>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight tooltip-demo">

    <!--list-->
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins m-b-none">
                <div class="tabs-container">
                    <div class="tab-content">
                        <div class="tab-pane active">
                            <div class="panel-body">
                                <table class="table table-bordered table-hover table-center">
                                    <thead>
                                    <tr>
                                        <th>编号</th>
                                        <th>盛塘周期</th>
                                        <th>总分红</th>
                                        <th>董事</th>
                                        <th>大区</th>
                                        <th>联创</th>
                                        <th>分红时间</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <!--/*@thymesVar id="row" type="com.shengtang.stagent.data.entity.FundSettleLogPO"*/-->
                                    <tr th:each="row,index:${list}">
                                        <td th:text="${row.logId}">123123</td>
                                        <td th:text="${row.cycleTag}">
                                            2019-05-10至2019-05-20
                                        </td>
                                        <td th:text="${row.totalBonus}">1211</td>
                                        <td>
                                            <span th:text="${row.dongshiNum}"></span>人
                                            <button type="button" th:attr="data-id=${row.logId}"
                                                    onclick="logHandler.showDetail(1,this)"
                                                    class="btn btn-default btn-xs m-b-none">明细
                                            </button>
                                            <input type="hidden" th:id="'detail_dongshi_'+${row.logId}"
                                                   th:value="${row.dongshiDetail}">
                                        </td>
                                        <td><span th:text="${row.daquNum}"></span>人
                                            <button type="button" th:attr="data-id=${row.logId}"
                                                    onclick="logHandler.showDetail(2,this)"
                                                    class="btn btn-default btn-xs m-b-none">明细
                                            </button>
                                            <input type="hidden" th:id="'detail_daqu_'+${row.logId}"
                                                   th:value="${row.daquDetail}">
                                        </td>
                                        <td><span th:text="${row.lianchuangNum}"></span>人
                                            <button type="button" th:attr="data-id=${row.logId}"
                                                    onclick="logHandler.showDetail(3,this)"
                                                    class="btn btn-default btn-xs m-b-none">明细
                                            </button>
                                            <input type="hidden" th:id="'detail_lianchuang_'+${row.logId}"
                                                   th:value="${row.lianchuangDetail}">
                                        </td>
                                        <td th:text="${#temporals.format(row.createTime,'yyyy-MM-dd HH:mm:ss')}"></td>

                                    </tr>
                                    </tbody>
                                </table>
                                <p style="float: left; margin: 20px 0;">
                                    共<span th:text="${totalRecords}"></span>条记录，当前第<span th:text="${pageIndex}"></span>/<span
                                        th:text="${totalPages==0?1:totalPages}"></span>，每页20条记录
                                </p>
                                <ul style="float: right;" class="pagination pagination-split">
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div id="bind_modal" class="modal-content-tag">
    <form id="saveForm">
        <input type="hidden" id="rebateId"/>
        <div class="form-horizontal" style="width: 450px;">
            <div class="form-group form-inline">
                <label class="col-sm-3 control-label">类型：</label>
                <div class="col-sm-9">
                    <input id="shareRoleType" class="form-control" style="border:0px;background-color: #fff;"
                           readonly="readonly"/>
                </div>
            </div>
            <div class="form-group form-inline">
                <div class="col-sm-12">
                    <textarea id="shareDetail" class="form-control" style="width: 444px;height: 430px;"></textarea>
                </div>
            </div>
        </div>
    </form>
</div>

<!--基础框架js-->
<script src="http://cdn.viptool.cn/lib/jquery/2.2.4/jquery.min.js"></script>
<script src="http://cdn.viptool.cn/lib/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="../../resource/hotui/js/hot/bootstrap.hot.extra-utils.js?20190316"
        th:src="@{/resource/hotui/js/hot/bootstrap.hot.extra-utils.js?20190316}"></script>
<script src="../../resource/hotui/js/hot/bootstrap.hot.extra-init.js?20190316"
        th:src="@{/resource/hotui/js/hot/bootstrap.hot.extra-init.js?20190316}"></script>
<script src="../../resource/hotui/js/content.min.js" th:src="@{/resource/hotui/js/content.min.js}"></script>

<script src="http://cdn.viptool.cn/lib/moment.js/2.19.2/moment.min.js"></script>
<script src="../../resource/hotui/js/plugins/datetimepick/js/daterangepicker.js"
        th:src="@{/resource/hotui/js/plugins/datetimepick/js/daterangepicker.js}"></script>
<script src="http://cdn.viptool.cn/lib/switchery/0.8.2/switchery.min.js"></script>

<script src="../../resource/lib/cityPicker/citydata.min.js"></script>
<script src="../../resource/lib/cityPicker/cityPicker-2.0.3.js"></script>

<script src="../../resource/lib/imageview/js/imageviewer.min.js"></script>

<script src="../../js/stagent.uri.constant.js"></script>

<script type="text/javascript" th:inline="javascript">
    const pageIndex = /*[[${pageIndex}]]*/  1;
    const totalPages = /*[[${totalPages}]]*/  0;
    const pageUri = /*[[@{/fund/settleLogList}]]*/  "";
</script>


<script src="https://cdn.bootcss.com/Mock.js/1.0.0/mock-min.js"></script>

<script>
    var checkModal = $("#bind_modal").modal("查看明细", function () {
        logHandler.deduct()
    });

    $(function () {
        //初始化分页
        var pageinate = new hot.paging(".pagination", pageIndex, totalPages, 7);

        pageinate.init(function (p) {
            tempRebateHandler.search(p);
        });
        $(document).keyup(function (event) {
            if (event.keyCode == 13) {
                $(".searchBtn").trigger("click");
            }
        });
    });

    var logHandler = {
        search: function (pageIndex) {
            $("input[name=pageIndex]").val(pageIndex);
            $("#searchForm").submit();
        },
        searchAll: function () {
            window.location.href = pageUri;
        },
        showDeduct: function (shareRoleType, data) {
            checkModal.show(function () {
                $('#shareRoleType').val(shareRoleType);
                $("#shareDetail").text(data);
            });
        },
        showDetail: function (type, obj) {
            var shareRoleType = '', idPrefix = '';
            if (type === 1) {
                shareRoleType = '董事分红';
                idPrefix = 'detail_dongshi_';
            } else if (type === 2) {
                shareRoleType = '大区分红';
                idPrefix = 'detail_daqu_';
            } else if (type === 3) {
                shareRoleType = '联创分红';
                idPrefix = 'detail_lianchuang_';
            }
            var logId = $(obj).attr('data-id');

            var data = $('#' + idPrefix + logId).val();
            var result = JSON.stringify(JSON.parse(data), null, 2);//将字符串转换成json对象
            var intro = '/**\n' +
                '\tallowShareFund：后台设置是否允许分红\n' +
                '\teligible：业绩考核结果\n' +
                '\tfailReason：业绩考核失败原因\n' +
                '\tlevelId：等级id  1->天使；2->一级；3->官方；4->总代；5->联创；6->大区；7->董事\n' +
                '\trealName:姓名\n' +
                '\trtDongshi:董事人头分红(1/13部分)\n' +
                '\trtDongshiAndDaqu:董事&&大区人头分红(2/13部分)\n' +
                '\trtDongshiAndDaquAndLianchuang: 董事&&大区&&联创人头分红(3/13部分)\n' +
                '\tselfAndTeamSaleNum:自己和下线团队销售总数量\n' +
                '\ttotalBonus:分红金额\n' +
                '\tuserId:用户id\n' +
                '\tuserName:手机号\n' +
                '\tyjDongshi:董事业绩分红(2/13部分)\n' +
                '\tyjDongshiAndDaqu:董事&&大区业绩分红(2/13部分)\n' +
                '\tyjDongshiAndDaquAndLianchuang:董事&&大区&&联创业绩分红(3/13部分)\n' +
                '\trepurchaseTaskCompleted:复销指标是否完成\n' +
                '\trepurchaseTaskRemark：复销指标完成描述\n' +
                '**/\n';
            this.showDeduct(shareRoleType, intro + result);
        }
    };
</script>
</body>
</html>
